var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/functionalComponent/table/editor/helpRef.ts
var helpRef_exports = {};
__export(helpRef_exports, {
  createEditorProps: () => createEditorProps
});
module.exports = __toCommonJS(helpRef_exports);
var import_util = require("../util");
var xtypeRef = {
  SingleHelp: {
    xtype: "help",
    type: "SingleHelp"
  },
  MultipleHelp: {
    xtype: "help",
    type: "MultipleHelp",
    multiple: true
  },
  OrgHelp: {
    xtype: "help",
    type: "OrgHelp"
  },
  UserHelp: {
    xtype: "help",
    type: "UserHelp"
  }
};
function createEditorProps(editor) {
  var _a, _b, _c, _d;
  let others = { ...editor };
  if (["help"].includes((_b = (_a = editor.type) == null ? void 0 : _a.toLowerCase) == null ? void 0 : _b.call(_a)) && editor.xtype) {
    others = { xtype: "help", type: editor.xtype };
  }
  const xType = (_d = (_c = others.xtype) == null ? void 0 : _c.toLowerCase) == null ? void 0 : _d.call(_c);
  if (xtypeRef[xType]) {
    return { ...others, ...xtypeRef[xType] };
  }
  if (["help"].includes(xType)) {
    const [cmp, defaultProps] = (0, import_util.getRegisterComponentWithProps)(others.type);
    if (cmp) {
      return { ...defaultProps, ...others, xtype: "help" };
    }
    return { ...others, xtype: "help" };
  } else {
    const [cmp, defaultProps, extendObj] = (0, import_util.getRegisterComponentWithProps)(xType);
    if (extendObj == null ? void 0 : extendObj.isHelp) {
      return {
        ...defaultProps,
        ...others,
        xtype: "help",
        type: xType
      };
    }
  }
  return others;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  createEditorProps
});
